from flask import Flask, jsonify

# 创建一个应用对象
app = Flask(__name__)


# 定义视图函数，设置路由规则
@app.route("/index")
def index():
    return "hello mock666"


@app.route("/login", methods=["POST"])
def login():
    data = {
        "code": 10000,
        "uid": 1001,
        "token": "xxx"
    }
    return jsonify(data)


if __name__ == '__main__':
    # 启动WEB服务器
    app.run()






